#include <QtGui/QDesktopServices>
#include <QtCore/QUrl>
#include <QtGui/QMessageBox>
#include "MyPixmapItem.h"

QMyPixmapItem::QMyPixmapItem( const QPixmap &pixmap, QGraphicsItem *parent /*= 0*/ )
: QGraphicsPixmapItem( pixmap, parent )
{
	setAcceptHoverEvents(true);
}

QMyPixmapItem::~QMyPixmapItem()
{

}

void QMyPixmapItem::hoverEnterEvent( QGraphicsSceneHoverEvent *event )
{
	qDebug("hoverEnterEvent \n");
	emit sig_MouseHoverIn();
	QGraphicsPixmapItem::hoverEnterEvent(event);
}

void QMyPixmapItem::hoverMoveEvent( QGraphicsSceneHoverEvent *event )
{

	qDebug("hoverMoveEvent \n");
	emit sig_MouseHoverIn();
	QGraphicsPixmapItem::hoverMoveEvent(event);
}

void QMyPixmapItem::hoverLeaveEvent( QGraphicsSceneHoverEvent *event )
{

	qDebug("hoverLeaveEvent \n");
	emit sig_MouseHoverOut();
	QGraphicsPixmapItem::hoverLeaveEvent(event);
}

void QMyPixmapItem::mousePressEvent( QGraphicsSceneMouseEvent *event )
{
	qDebug("mousePressEvent\n");
	QUrl url(URL());
	QDesktopServices::openUrl( url );
	QGraphicsPixmapItem::mousePressEvent(event);
}

